
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>点评发布</title>
  <{include file="header.html"}>
<style type="text/css">
  #first_a{
  width:241px;
  border:1px solid #CCC;
}
#first_a tr:hover{
  background:#969;
}
#first_a table{
width:100%;
}
#first_a{
  display:none;
}
</style>
    <div id="cont">
        <div id="tban">
            <div id="tban_le">
                <div id="tban_le_01">
                    <img src="../../tpl/images/nlw_dqbg2.jpg" width="10" height="103" />
                </div>
                <div id="tban_le_02">
                    <h1>
                        厦门周边旅游景点
                    </h1>
                    <div id="tban_le_txt">
                        厦门周边旅游景点大全，推荐当季最佳最受欢迎的旅游景点，还有适合周末休闲的好去处。
                    </div>
                </div>
                <div id="tban_le_03">
                    <img src="../../tpl/images/nlw_dqbg4.jpg" width="10" height="103" />
                </div>
            </div>
            <div id="tban_ri">
                <div id="tban_le_01">
                    <img src="../../tpl/images/nlw_dqbg2.jpg" width="10" height="103" />
                </div>
                <div id="tban_le_02">
                    <h1>
                        推荐分类
                    </h1>
                    <div id="tban_le_txt" class="tgray1">
                        厦门周边一日游 厦门周边农家乐 厦门有什么好玩的地方
                    </div>
                </div>
                <div id="tban_le_03">
                    <img src="../../tpl/images/nlw_dqbg4.jpg" width="10" height="103" />
                </div>
            </div>
        </div>
    </div>
    <div id="cont">
        <div id="d_tit06">
            点评发布</div>
        <div id="d_bk_t">
            <div id="d_bk_t01">
                <div class="c1">
                </div>
            </div>
            <div id="d_bk_t02">
                <div class="c1">
                </div>
            </div>
        </div>
            <div id="userinfo_bk">
              <div id="userinfo_bk2">
                <table width="800" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#d1d1d1">
                    <input type="hidden" name="replyid"  id="replyid" size="60" value="<{$replyid}>">
                    <input type="hidden"  name="provinceid" id="provinceid" value="<{$provinceid}>">
                    <input type="hidden"  name="cityid" id="cityid" value="<{$cityid}>">
                    <input name="username" type="hidden"  id="username" size="60" value="<{$username}>" />
                    <input type="hidden"  name="types" id="types" value="<{$types}>">
                    <input type="hidden"  name="linkid" id="linkid" value="<{$linkid}>">
                    <input type="hidden" class="tab_txt1" name="userid" id="userid" value="<{$userid}>">

                    <tr>
                        <td height="55" class="tab_left">
                            内容：
                        </td>
                        <td bgcolor="#FFFFFF" class="tab_right">
                            <textarea name="content" id="content" class="tab_txt1" style="width:610px;height:450px;visibility:hidden;"><{$content}></textarea>
                            <span class="torange1"></span>
                        </td>
                    </tr>
                    <tr>
                        <td height="55" class="tab_left"> 
                        </td>
                        <td bgcolor="#FFFFFF" class="tab_right">
                            <a id="ex3button" href="javascript:;"><img src="../../../tpl/images/nlw_bt3.gif" width="148" height="36" /></a>
                            <input type="hidden" name="id" id="id" value="<{$id}>">
                        </td>
                    </tr>
                </table>
                </div>
      </div>
  <div id="d_bk_b">
            <div id="d_bk_b01">
                <div class="c1">
                </div>
            </div>
            <div id="d_bk_b02">
                <div class="c1">
                </div>
            </div>
        </div>
    </div>

<script type="text/javascript" src="<{$domain}>/tpl/js/jquery-1.7.0.min.js"></script> 
<script src="../../../kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="../../../kindeditor/lang/zh_CN.js"></script>
<script>
 var editor;
      KindEditor.ready(function(K) {
        editor = K.create('textarea[name="content"]', {
          resizeType : 1,
          allowFileManager : true,
          allowPreviewEmoticons : false,
          allowImageUpload : false,
          items : [
            'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
            'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
            'insertunorderedlist', '|', 'emoticons', 'image', 'link']
   });

  K('input[name=getHtml]').click(function(e) {
    alert(editor.html());
  });
  K('input[name=isEmpty]').click(function(e) {
    alert(editor.isEmpty());
  });
  K('input[name=getText]').click(function(e) {
    alert(editor.text());
  });
  K('input[name=selectedHtml]').click(function(e) {
    alert(editor.selectedHtml());
  });
  K('input[name=setHtml]').click(function(e) {
    editor.html('<h3>Hello KindEditor</h3>');
  });
  K('input[name=setText]').click(function(e) {
    editor.text('<h3>Hello KindEditor</h3>');
  });
  K('input[name=insertHtml]').click(function(e) {
    editor.insertHtml('<strong>插入HTML</strong>');
  });
  K('input[name=appendHtml]').click(function(e) {
    editor.appendHtml('<strong>添加HTML</strong>');
  });
  K('input[name=clear]').click(function(e) {
    editor.html('');
  });
});
</script>
<script type="text/javascript">
$(document).ready(function(){ // 当页面加载完毕的时候
	// 例子三
	$("#ex3button").click(function(){ // "提交"按钮被点击
		// 构造发送的数据，请注意如果获取表单各项的值
		var formdata = {
			'id' : $('#id').val(),
			'replyid' : $('#replyid').val(),
			'username' : $('#username').val(),
			'content' : editor.html(),
			'provinceid' : $('#provinceid').val(),
			'cityid' : $('#cityid').val(),
			'types' : $('#types').val(),
			'linkid' : $('#linkid').val(),
			'userid' : $('#userid').val()
		};
		var id  = $('#id').val();  // 根据有没有id 判断是编辑还是增加
        var newId;
		if(id == '')
		{
			// 用$.post发送数据
			$.post('<{spUrl c=commentinfoform a=adddata}>', formdata, function(result){
                $('#resulttable').append(result);
                newId =result.match(/^\d.*$/);
                feedback(result,id,newId);
			});
		}
		else
		{
		   	// 用$.post发送数据
			$.post('<{spUrl c=commentinfoform a=editdata}>', formdata, function(result){
				$('#resulttable').append(result); // 返回的数据直接追加到resulttable表格的后面
        alert(result);
				feedback(result,id);
			});
		}
	});
});
</script>
<script>
    function feedback(result,id,newId){
        if(newId == null)
        {
            $('.badge').removeClass('badge badge-info').text('');
            var response = eval("("+result+")");
            for(var i in response){
                $('#' + i).next().addClass('badge badge-info');
                $('#' + i).next().text(response[i].toString());
//      console.log(response[i].toString());
            }
            //$('.badge').text('sdfsd');
        }
        else
        {
            window.location.href="<{spUrl}>comment/info/"+newId+".html";
        }
    }
</script>
<{include file="footer.html"}>